﻿function popWin(selectAction, Title) {
    setTimeout(
                  function() {
    ymPrompt.win({ message: selectAction ,
                          width: 800,
                          height: 640,
                          title: Title,
                          handler: null,
                          maxBtn: true,
                          minBtn: true,
                          iframe: true
                      });
                  }, 50);
    return false;
}
function removeDW() {
    $("#ctl00_MainContent_HidDWID").val("");
    $("#ctl00_MainContent_selectDW").html("单位关联");
    $("#ctl00_MainContent_removeDW").css("display", "none");
    $("#ctl00_MainContent_HidDWXFGX").val("");

    var offset = $("#ctl00_MainContent_txtDWMC").offset();
    var divmsg = $("#unbindMsg");
    divmsg.offset({ top: offset.top, left: offset.left });
    divmsg.css("display", "");
    divmsg.fadeOut(1500);
    return false;
}


function selDWClick() {
    var dwxfgx = $("#ctl00_MainContent_HidDWXFGX").val();
    var dwmc = $("#ctl00_MainContent_txtDWMC").val();

    popWin("JZXK_DWSELPage.aspx?operator=seljz&DWMC=" + dwmc+ "&DWXFGX=" + dwxfgx, "选择单位") ;
    
}

function selJZClick() {
    var dwid = ""; //$("#ctl00_MainContent_HidDWID").val();
    var dwmc = ""; //$("#ctl00_MainContent_txtDWMC").val();
    var jzxfgx = "";
    var dwxfgx = $("#ctl00_MainContent_HidJZXFGX").val();
    var jzmc = $("#ctl00_MainContent_txtXKSMC").val();

    if (jzxfgx == "") {
       jzxfgx = dwxfgx;
    }
    if (jzmc == "") {
       dwmc = $("#ctl00_MainContent_txtDWMC").val();
    }
    var url = "JZXK_JZSELPage.aspx?DWMC=" + dwmc + "&DWID=" + dwid + "&JZXFGX=" + jzxfgx + "&JZMC=" + jzmc;
    popWin(url, "选择建筑");
    return false;
}


function unbindJZClick() {
    $("#ctl00_MainContent_HidJZID").val("");
    $("#ctl00_MainContent_HidJZXFGX").val("");
    $("#ctl00_MainContent_abindJZ").html("建筑关联");
    $("#ctl00_MainContent_aunbindJZ").css("display", "none");

    var divmsg = $("#divUnbinJZMsg");

    divmsg.css("display", "");
    divmsg.fadeOut(1500);
}

/*其他消防设施响应事件*/
function chkQT_CheckedChanged() {
if ($("#ctl00_MainContent_chkQT").attr("checked")) {
    $("#ctl00_MainContent_txtQTXFSS").attr("readonly", false);
}
else {
    $("#ctl00_MainContent_txtQTXFSS").attr("readonly", true);
    $("#ctl00_MainContent_txtQTXFSS").val("");
}
}